<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>会员列表</title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<!--右侧内容-->
					<div class="rigtop">
						<span class="title">会员列表</span>
					</div>
					<div class="indrig_con">
						<div class="zizh_conbox" style="padding-top: 20px;">
							<!--选项卡内容开始-->
							<form id="my_form" action="{:url('oem/accounts/user')}" method="post">
								<div class="zizh_con_1">
									<div class="shxx_row chax_row  clearfix">
										<div class="left">会员帐号：</div>
										<div class="right clearfix">
											<input type="text" name="mobile" value="{$mobile}" id="mobile" placeholder="手机号码" class="chax_input" />
										</div>
										<button type="submit" class="htcxbtn">查询</button>
									</div>
							</form>
							<div class="chax_jiegbt clearfix">
								<div class="chax_jieg">总计：{$list->total();}个</div>
								<div class="chax_xzbtnbox">
									<a href="javascript:;" onclick="check()"><i class="iconfont icon-download"></i>会员下载</a>
								</div>
							</div>
							<div class="chax_conbox">
								<div class="chax_jiegnr">
									<table class="zizh_table1 zizh_table2">
										<thead>
											<tr>
												<th class="w_10">ID</th>
												<th class="w_10">手机号</th>
												<th class="w_20">会员名</th>
												<th class="w_10">状态</th>
												<th class="w_20">注册时间</th>
												<th class="w_10">操作</th>
											</tr>
										</thead>
										<tbody id="tbody">
											{volist name="list" id="vo" empty="$empty"}
											<tr>
												<td>{$vo.id}</td>
												<td>{$vo.mobile}</td>
												<td>{$vo.mobile?$vo.user_name:'扫码会员'}</td>
												<td>
												{if $vo.status==1}
												正常
												{else /}
												冻结 
												{/if}
												</td>
												<td>{$vo.add_time}</td>
												<td>
													{if $vo.status == 1}
													<a href="javascript:;" onclick="caozuo('{$vo.id}','2')">冻结</a>
													{else/}
													<a href="javascript:;" onclick="caozuo('{$vo.id}','1')" class="green">解冻</a>
													{/if}
													<a href="javascript:;" onclick="show_user('{$vo.id}')">详情</a>
												</td>
											</tr>
											{/volist}
										</tbody>
									</table>
									<div class="fenye" style="display: block;">
										{$list->render()}
									</div>
								</div>
							</div>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}

	</body>

</html>
<script>
function check() {
	var mobile = $('#mobile').val();
	window.location.href = "/oem/accounts/user_dcxml.html?mobile="+mobile;
}
/*操作*/
function caozuo(id,status) {
	layer.confirm('您确定要改变吗？', {
		btn: ['确定', '取消'] //按钮
	}, function() {
		$.ajax({
			url: "{:url('accounts/user_status')}",
			data: {
				id:id,
				status:status
			},
			dataType: 'json',
			success: function(data) {
				layer.msg("成功", {
					icon: 1,
					time: 1000
				}, function() {
					location.href = "{:url('accounts/user')}";
				});
			}
		})
	})
}

function show_user(id) {
	var url = 'show_user?id=' + id;
	layer.open({
		type: 2,
		title: '会员详情',
		shadeClose: true,
		shade: 0.8,
		area: ['500px', '500px'],
		content: [url]
	});
}

</script>